<template>
  <p
    :style="{ paddingTop: top + 'px' }"
    class="w-hover-text w-pointer"
    @click="copyClick"
  >
    <slot />
  </p>
</template>

<script>
export default {
  name: 'ComGlobalCopyText',
  props: {
    text: {
      type: String,
      default: ''
    },
    top: {
      type: Number,
      default: 0
    }
  },
  methods: {
    copyClick () {
      const text = this.text
      this.$wCopy(this.text)
    }
  }
}
</script>

<style scoped></style>
